//package com.example.demo.task;
//
//import com.example.demo.mapper.PeerMapper;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//@Component
//public class PeerCleanupTask {
//
//    private final PeerMapper peerMapper;
//
//    @Autowired
//    public PeerCleanupTask(PeerMapper peerMapper) {
//        this.peerMapper = peerMapper;
//    }
//
//    @Scheduled(fixedRate = 3600000) // 每小时清理一次
//    public void cleanupExpiredPeers() {
//        peerMapper.cleanupExpiredPeers();
//    }
//}